home *** CD-ROM | disk | FTP | other *** search
/ Netscape Plug-Ins Developer's Kit / Netscape_Plug-Ins_Developers_Kit.iso / CGIPERL / MACPERL / MSRCE418.HQX / Perl Source ƒ / MacPerl / MacPerl.Frontend < prev    next >
Encoding:
Text File  |  1994-12-03  |  5.5 KB  |  106 lines

  1. Front end features of MacPerl                    Matthias Neeracher 03Dec94
  2.  
  3. This file describes features only present in the MacPerl application, which
  4. are not directly related to the language itself.
  5.  
  6. 1. USER INTERFACE
  7.  
  8. This area is notoriously underdocumented. I can't give more than hints at the moment
  9. (I have a standing offer to write decent manuals if anybody researches and writes my 
  10. PhD thesis for me :-):
  11.  
  12. a) Online Help
  13.  
  14. Selecting any perl operator and choosing Help from the Help menu (That's the question 
  15. mark icon on the right side of the menubar) will give you chapter and verse from the
  16. Perl manual page.
  17.  
  18. If you turn on Balloon Help and point at a Perl operator, a balloon will give you
  19. a summary of parameters to the operator.
  20.  
  21. a) Menus
  22.  
  23. MacPerl for the most part tries to behave like a typical primitive text editor.
  24. "Format" in the Edit menu presents a choice of text fonts and sizes. "Preferences"
  25. controls many settings, the most important of which is a list of library folders.
  26.  
  27. "Jump to╔" in the Edit menu allows to pop up files and lines based on the current 
  28. selection. The following formats are supported:
  29.  
  30.    Format                                  Example
  31.    /File\s+["']([^"']+)["']\D*(\d+)/i      File "om:mani:padme:hum", Line 23
  32.    /["']([^"']+)["']\D*(\d+)/              "om:mani:padme:hum", Line 23
  33.    /["']([^"']+)["']/                      "om:mani:padme:hum"
  34.    /.+/                                           om:mani:padme:hum
  35.     
  36. 2. PACKAGES
  37.  
  38. A MacPerl file can be saved in various forms, depending on what you choose 
  39. from the popup menu in the "Save As..." dialog:
  40.  
  41.  - A plain text file. These can be opened from any text editor or word processor.
  42.  - A droplet. This combines the script and some glue code into a "Mini-application".
  43.    These will automatically run when double-clicked from the finder, and all files
  44.     you drop on them in the Finder will appear in the @ARV array.
  45.  - A runtime. While they in some respects behave like droplets, they are much more
  46.    heavyweight and will set you back several 100K every time you save one. The 
  47.     advantage of runtimes is that they run without the MacPerl application.
  48.  - Any other packaging you could think of. A MacHTTP package will appear in a few
  49.    days. The release verson of MacPerl 4.1.4 will describe how to add packaging
  50.     options to MacPerl.
  51.  
  52. 3. APPLEEVENTS/APPLESCRIPT
  53.  
  54. MacPerl has been scriptable and recordable since version 4.1.0. Most AppleEvents
  55. supported are the fairly conventional text events you'll find in the Scriptable
  56. Text Editor. In fact, MacPerl should support pretty much the same text manipulations
  57. as STE, except that STE generates somewhat prettier scripts when being recorded. If
  58. you find something working in STE and not in MacPerl, talk to me about it!
  59.  
  60. The only two events that are somewhat special to MacPerl are Save and Do Script.
  61.  
  62. Event:                    Save [core/save]
  63. Direct parameter:        A window object reference [obj ], a file [fss ], or text [TEXT]
  64. "in" [dest] (opt):    A file [fss ] to save in.
  65. "as" [fltp] (opt):    A save type [svas] (standard types are Text [TEXT], Droplet [SCPT]
  66.                      and System 7 runtime [MrP7] or an enumeration cast to [svas]).
  67.  
  68. This event does the same as the core save event, but it can also save files not open
  69. at the time and even on-the-fly text, and it can save in any package available. This
  70. is useful to e.g. save a file as a MacPerl droplet from another application.
  71.  
  72. Event:                    "Do Script" [misc/dosc]
  73. Direct parameter:        A file [fss ], text [TEXT] or a list of files and text.
  74. Reply:               Text results, depending on mode.
  75. "extract" [EXTR] (opt): A boolean [bool] which when false prevents searching for a #! line.
  76. "debug" [DEBG] (opt):A boolean which when true runs the Perl debugger
  77. "mode" [MODE] (opt): A mode [MODE], one of Local [LOCL], Batch [BATC], Remote [RCTL].
  78. "environment" [ENVT] (opt): A list of text [TEXT] variable/value pairs to add to the 
  79.                      environment.
  80. [SASE] (opt):        A record used as a callback event for remote mode.
  81.  
  82. As opposed to the standard "Do Script" event, MacPerl's "Do Script" accepts a list as
  83. the direct parameter and stuffs all further elements into @ARGV. The mode parameter
  84. has a major influence on the way the script is executed:
  85.  
  86.  - Local mode is the default. The script just runs and only returns text if you call
  87.    &MacPerl'Reply().
  88.  - Batch mode redirects standard output and error to the reply apple event. Standard
  89.    output is put into the direct parameter of the reply, while standard error is
  90.     put into element [diag] of parameter [OUTP].
  91.  - Remote control mode returns immediately from the DoScript request. Clients are
  92.    then expected to communicate with MacPerl with "Send Data" [McPL/DATA] events.
  93.     These contain standard input in the direct parameter and output as explained 
  94.     above. Furthermore, the 'WANT' parameter of the reply contains enumeration codes
  95.     for all input descriptors awaiting input. Sending a null descriptor with any
  96.     code signals an end of file for that file. If you did specify a SASE parameter
  97.     in your Do Script or Send Data events, it will be sent back to you the next 
  98.     time MacPerl waits for input.
  99.  - Both Batch and Remote control mode support opening further input and output
  100.    streams as "Dev:AEVT:[4 byte code]". Standard input/output is "Dev:AEVT", standard
  101.     error is "Dev:AEVT:diag". Note that these names are case sensitive!
  102.  
  103. Furthermore, you can specify environment settings which will show up in %ENV in the
  104. environment parameter. If you specify a value for "PERLLIB", the library folders
  105. specified in the "Preferences╔" dialog are appended to the value you specify.
  106.